package top.zsc.cloud.demo.system.service.impl;

import org.springframework.stereotype.Service;
import top.zsc.cloud.demo.system.mapper.DeptMapper;
import top.zsc.cloud.demo.system.po.Dept;
import top.zsc.cloud.demo.system.service.DeptService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Resource
    private DeptMapper deptMapper;

    @Override
    public int insert(Dept dept) throws Exception {
        return deptMapper.insert(dept);
    }

    @Override
    public int update(Dept dept) throws Exception {
        return deptMapper.updateService(dept);
    }

    @Override
    public List<Dept> selectAll() throws Exception {
        return deptMapper.selectAll();
    }

    @Override
    public Dept selectByPk(Integer pk) throws Exception {
        return deptMapper.selectByPrimaryKey(pk);
    }
    @Override
    public List<Dept> selectByDept(Dept dept) throws Exception {
        return deptMapper.select(dept);
    }
}
